<?php

// uncomment the following to define a path alias
// Yii::setPathOfAlias('local','path/to/local-folder');

// This is the main Web application configuration. Any writable
// CWebApplication properties can be configured here.
return array(
	'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',
	'name'=>'Melbourne Coffee Review',

	// preloading 'log' component
	'preload'=>array('log'),

	// autoloading model and component classes
	'import'=>array(
		'application.modules.user.models.*',
		'application.models.*',
		'application.components.*',
		'application.helpers.*',
		'application.widgets.*',
	),
	'modules' => array(
			'user' => array(
		    	'debug' => true
			),
			'JumpOrder'=>array(
				'enabled'=>false,
			)
		),
	'controllerMap' =>array(
		'sms'=>array(
			'class'=>'application.controllers.SmsController',
			'smsUsername'=>'sms_user',
			'smsPassword'=>'sms_pass'
			),
		),

	// application components
	'components'=>array(
		 'request'=>array(
            'enableCsrfValidation'=>(isset($_POST['notificationType'])||isset($_POST['txn_id']/* paypal */))?false:true,//do not valid sms request
			'enableCookieValidation'=>true,
			'behaviors'=>array('agentEnhance'=>array(
				    'class'=>'ext.erequest.ERequestUserAgent'
				)
			)
        ),
		
		'user'=>array(
			// enable cookie-based authentication
			'allowAutoLogin'=>true,
			'loginUrl' => array('/user/user/login'),
		),
		'User'=>array(
		      'class' => 'User',
		),
		
		
		
		'urlManager'=>array(
			'urlFormat'=>'path',
			'rules'=>array(
				'page/<view>'=>'site/page',
				'jumporder'=>'JumpOrder',
				'jumporder/<c>/<a>'=>'JumpOrder/<c>/<a>',
				'<controller:\w+>/<id:\d+>'=>'<controller>/view',
				'<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',
				'<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
			),
			'showScriptName'=>false,
		),
		'session' => array(
                        'class' => 'CDbHttpSession',
                        'connectionID' => 'db',
						'sessionTableName'=>'mcr_activesession',
						// **** uncomment this in production
						'autoCreateSessionTable' => false,		
		),
		
		'db'=>array(
			'connectionString' => 'mysql:host=localhost;dbname=jmelbour_mcrapp',
			'emulatePrepare' => true,
			'username' => 'jmelbour_mcrhsh',
			'password' => 'mcrhsh058',
			'charset' => 'utf8',
			'tablePrefix'=>'mcr_',
			'initSQLs'=>array("set names 'utf8';"),
		),
		'authManager'=>array(
			'class'=>'CDbAuthManager',
		 	'connectionID'=>'db',
			'itemTable'=>'mcr_AuthItem',
			'itemChildTable'=>'mcr_authitemchild',
			'assignmentTable'=>'mcr_AuthAssignment',
        	'defaultRoles'=>array('authenticated', 'guest','cafeOwnerSubscribe'),
		),
		'mailer' => array(
			'class' => 'application.extensions.mailer.EMailer',
			'fromName'=>'Melbourne Coffee Review',
			'fromEmail'=>'support@melbournecoffeereview.com',
			'replyTo'=>'support@melbournecoffeereview.com',
			'useSmtp'=>false,
			'smtpHost'=>'mail.tpg.com.au',
		),
		
		'menuManager'=>array(
			'class'=>'ext.epmenu.EPMenuManager',
			'menus'=>require(dirname(__FILE__).'/sitemap.php'),
			'processors'=>array(
				'css'=>array(
					'class'=>'ext.epmenu.processor.EPMenuDefaultCssProcessor',
				),
				'active'=>array(
					'class'=>'ext.epmenu.processor.EPMenuActiveProcessor',
				),
				'depth'=>array(
					'class'=>'ext.epmenu.processor.EPMenuDepthOrderProcessor',
				),
				'role'=>array(
					'class'=>'ext.epmenu.processor.EPMenuRoleProcessor',
				),
			),
			'defaultCssPrefix'=>'',
			'menuIdPrefix'=>'menu_',
			
		),// menuManager Ends
		'image'=>array(
            'class'=>'ext.image.CImageComponent',
            // GD or ImageMagick
            'driver'=>'GD',
            // ImageMagick setup path
            //'params'=>array('directory'=>'D:/Program Files/ImageMagick-6.4.8-Q16'),
        ),
		
		'sms'=>array(
			'class'=>'ext.sms.ESms',
			'username'=>'peter.christo@melbournecoffeereview.com',
			'password'=>'NDX4212',
			'accountReference'=>'EX0063720',
			'originator'=>'MCR',			
			'behaviors'=>array(),
		),
		'google'=>array(
			'class'=>'application.components.GoogleUtil',
			'markerIcon'=>'/images/hotshot.png',
			'key'=>'ABQIAAAA6kkCRGtwj5wMyktMWKuGUBRsOa4usY949YH4q4Y3WEZZtsZ6rhRioeyqOCsWfvcWXmmP79shtJd4QA'
		),
		'twitter'=>array(
			'class'=>'ext.twitter.ETwitter',
			'consumerKey'=>'ICudrTUHNKUeQANANGYw',
			'consumerSecret'=>'vqjrWu2ZQlqiJvwQ9N9PjxT8MkqnINAIqiXugOsafg',
			'userToken'=>'23923406-YB5Z1aeFb4BTkvazkCpgbsq91eQZGaoh7PB6YHRnd',
			'userSecret'=>'r41iEvxwE9lopUeUYYEjyYNpCuVFpVA9paUgHLlZNe4',
		),

		'zoho'=>array(
			'class'=>'ext.zoho.EZoho',
			'username'=>'peter.christo@christopartners.com',
			'password'=>'320ven',
			'apiKey'=>'yqoawGoamOOnz6jl8wLgSYnOgj-UcXdSkQaMGWeIdlI$',
		),
		'paypal'=>array(
			'class'=>'ext.paypal.EPayPal',
			'debug'=>false,
			'currencyCode'=>'AUD',
			'business'=>'peter.christo@christo.com.au',
			//'debug'=>true,
			//'business'=>'platin_1185334150_biz@gmail.com',
		),
		
		'errorHandler'=>array(
			// use 'site/error' action to display errors
            'errorAction'=>'site/error',
        ),
		'log'=>array(
			'class'=>'CLogRouter',
			'routes'=>array(
				array(
	 				'class'=>'CFileLogRoute',
	 				//'levels'=>'',
	  				'categories'=>'mcr.*',
	  				'logFile' => 'mcr.log'
  				),
  				array(
					'class'=>'CFileLogRoute',
					'levels'=>'error, warning',
				),
				array(
	 				'class'=>'CFileLogRoute',
	 				'levels'=>'',
	  				'categories'=>'ext.epaypal.*',
	  				'logFile' => 'paypal.log'
  				),
  				
				// uncomment the following to show log messages on web pages
				/*
				array(
					'class'=>'CWebLogRoute',
				),
				*/
			),
		),
		'widgetFactory'=>array(
		      'widgets'=>array(
		            'CJuiDatePicker'=>array(
		            		'options'=>array(
								'dateFormat' =>'dd/mm/yy',
								'altFormat'=>'@',
								'changeMonth'=>true,
								'changeYear'=>true,
								'showOtherMonths'=>true,
							),
							'htmlOptions'=>array(
						        'readonly'=>'readonly'
						    ),
		             ),
		       ),
		),
 		'format'=>array(
			'datetimeFormat' => 'd/m/Y g:i:s a',
			'dateFormat' => 'd/m/Y',
		),
	),

	// application-level parameters that can be accessed
	// using Yii::app()->params['paramName']
	'params'=>array(
		// this is used in contact page
		'adminEmail'=>'peter.christo@melbournecoffeereview.com',
		'alertEmail'=>'alert1@melbournecoffeereview.com',
		'mcrVote'=>true,
		'mcrVotePeriod'=>'2012',
	),
);